<?php
namespace app\api\controller;


use think\Db;

class Integral extends Common
{
    public function getIntegralRecord(){
        $data = $this->checkSign(true);
        $list = Db::name('users_integral')->where('user_id',$data['user_id'])
            ->field('type,integral,after_integral,create_time')
            ->order('id','desc')
            ->select();
        return package(0,'success',[
            'list'=>$list,
            'integral'=>Db::name('users')->where('id',$data['user_id'])->value('integral')
        ]);
    }
}